﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace DispatchAssist.BusinessLogical.Model
{
    /// <summary>
    /// SeatUser
    /// </summary>
    public class SeatUser
    {

        /// <summary>
        /// SeatUser 构造函数
        /// </summary>
        public SeatUser()
        { }


        /// <summary>
        /// SeatUser OR映射构造函数
        /// </summary>
        public SeatUser(System.Data.IDataReader dr)
        {
            this.UserID = (Guid)dr["UserID"];
            this.UserName = Convert.ToString(dr["UserName"]);
            this.Password = (byte[])dr["Password"];
            this.RoleID = (Guid)dr["RoleID"];
            this.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
            this.DeleteFlag = Convert.ToBoolean(dr["DeleteFlag"]);
        }

        /// <summary>
        /// 用户唯一标识
        /// </summary>
        public Guid UserID { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public byte[] Password { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        public Guid RoleID { get; set; }

        /// <summary>
        /// 角色名称
        /// </summary>
        public string  RoleName { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime LastModifyTime { get; set; }

        public List<Seat> DelegateSeats { get; set; }

        /// <summary>
        /// 逻辑删除标记
        /// </summary>
        public bool DeleteFlag { get; set; }

        public string UserStatus { get; set; }

        public int PowerFlag { get; set; }

        public override string ToString()
        {
            return string.Format("[用户名:{0}]", this.UserName);
        }
    }
}
